#include "stdafx.h"

#include "Bolide.h"
#include "FerrariBolid.h"
#include "MercedesBolide.h"

#include "TireBehavior.h"
#include "IntermediateTire.h"
#include "RainTire.h"

void Race(std::auto_ptr<Bolide> firstBolide, std::auto_ptr<Bolide> secondBolide)
{
    std::cout << "The race is on" << std::endl;
    
    firstBolide->Move();
    secondBolide->Move();

    std::cout << "Started to rain" << std::endl;
    std::cout << "Need to change a tire" << std::endl;

    firstBolide->SetTires(std::auto_ptr<TireBehavior>(new IntermediateTire()));
    secondBolide->SetTires(std::auto_ptr<TireBehavior>(new RainTire()));

    firstBolide->Move();
    secondBolide->Move();

}

int main(int argc, char * argv[])
{
    std::auto_ptr<Bolide> ferrari(new FerrariBolid());
    std::auto_ptr<Bolide> mercedes(new MercedesBolide());

    Race(ferrari, mercedes);

	return 0;
}

